<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InstallSentryUsers extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function($table)
        {
            $table->increments('id');
            $table->string('email', 127)->nullable();
            $table->string('password', 63)->nullable();
            $table->text('permissions')->nullable();
            $table->boolean('activated')->default(0);
            $table->string('activation_code', 63)->nullable();
            $table->timestamp('activated_at')->nullable();
            $table->timestamp('last_login')->nullable();
            $table->string('persist_code', 63)->nullable();
            $table->string('reset_password_code', 63)->nullable();
            $table->string('full_name', 127)->nullable();
            $table->string('phone', 31)->nullable();
            $table->tinyInteger('gender')->nullable();
            $table->date('dob')->nullable();
            $table->string('address', 255)->nullable();
            $table->string('avatar', 255)->nullable();
            $table->string('secret_key', 30);
            $table->tinyInteger('is_banner')->default(0);
            
            $table->timestamps();
			$table->softDeletes();
            $table->tinyInteger('is_deleted');

            // We'll need to ensure that MySQL uses the InnoDB engine to
            // support the indexes, other engines aren't affected.
            $table->engine = 'InnoDB';
            $table->index('email');
            $table->index('activation_code');
            $table->index('reset_password_code');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }

}
